/**
 * @description Vuex模块：问答的进度以及选中的数据信息。因为页面特性,所以需要把数据放在vuex中储存。
 * @author yinzhi
 * @date 2025-03-04
 */
export default {
    namespaced: true,
    state: {
        // 问答进度或者说是第几个问题
        currentIndex: 1,
        // 选中的回答列表
        selectedAnswers: []
    },
    getters: {
        currentIndex: state => state.currentIndex,
        selectedAnswers: state => state.selectedAnswers
    },
    mutations: {
        setCurrentIndex(state, val) {
            state.currentIndex = val
        },
        setSelectedAnswers(state, arr) {
            state.selectedAnswers = arr
        },
        // 清除数据
        clearDate(state) {
            state.currentIndex = 1
            state.selectedAnswers = []
        }
    },
    actions: {}
}
